<? 
include('adodb/adodb.inc.php');



function conecta()
{

	$db = &ADONewConnection('odbc_mssql');
	#$db->debug = true;
	$dsn = "Driver={SQL Server};Server=192.168.0.102;Database=ecrmNissan;";
	$db->Connect($dsn,'sa','');
	$db->SetFetchMode(ADODB_FETCH_ASSOC);

    return $db;

} 

function desconecta()
{
  extract($GLOBALS);


  $Conn=null;

  return $function_ret;
} 

function traerecordset($lsQuery)
{
  extract($GLOBALS);


$conexion=conecta();
//set rsd=Server.CreateObject("ADODB.Recordset")

//rsd.CursorType = 2

//rsd.LockType = 1

//rsd.ActiveConnection= conexion

$rsd=$conexion->execute($lsQuery);


  return $rsd;
} 






?>
